package im.xz.cn.tpplayer1206;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.Plugin;
public class tpp_logoutEvent implements Listener {
    Plugin plugin = im.xz.cn.tpplayer1206.TpPlayer_1206.getPlugin(im.xz.cn.tpplayer1206.TpPlayer_1206.class);
    @EventHandler
    public void qwq(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        try {
            for (int i = 0;i<=35;i++) {
                try {
                    if (player.getInventory().getItem(i).getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&',plugin.getConfig().getString("itemName")))) {
                        player.getInventory().getItem(i).setAmount(0);
                    }else {
                    }
                }catch (NullPointerException ignore) {
                }
            }
        }catch (NullPointerException ignore) {
        }
    }
}